package com.example.back.mapper;

import com.example.back.entity.Relations;

public class relationProvider {

    public String queryRelation(Relations  relations) {
        StringBuilder sb = new StringBuilder();
        sb.append("SELECT * from relations WHERE 1=1 ");
        if (relations.getFanId()!=null){
            sb.append(" and fanId=#{fanId} ");
        }
        if (relations.getUserId()!=null){
            sb.append(" and userId =#{userId} ");
        }
        return sb.toString();
    }
}
